package com.intct.util;

import org.apache.flink.api.java.utils.ParameterTool;

import java.io.IOException;
import java.lang.reflect.Parameter;

/**
 * @author gufg
 * @since 2025-07-03 15:22
 */
public class ParmUtil {
    private static ParameterTool parameterTool ;
    static {
        // flink run -p 4 --aaa value
        try {
            parameterTool = ParameterTool.fromPropertiesFile(ParmUtil.class.getResourceAsStream("/dim.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static String getValue(String key, String defaultValue) {
        return parameterTool.get(key, defaultValue);
    }

    public static void main(String[] args) {
        System.out.println(getValue("hbase-zk-addr", "aaaaa"));
    }
}
